import com.google.common.collect.Lists;
import java.math.BigDecimal;
import java.util.List;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.okcoin.OkCoinExchange;
import org.knowm.xchange.service.marketdata.MarketDataService;

/**
 * Created by lujango on 2018/7/25.
 */
public class okex {
  public static void main(String[] args) throws Exception {
    Exchange bitstamp = ExchangeFactory.INSTANCE.createExchange(OkCoinExchange.class.getName());

    MarketDataService marketDataService = bitstamp.getMarketDataService();

    List list = Lists.newArrayList();

    for (int i = 0; i < 100; i++) {
      BigDecimal last =marketDataService.getTicker(CurrencyPair.ETH_BTC).getLast();
      list.add(last);
    }

    System.out.println("result :"+list.toString());
  }
}
